<!DOCTYPE html>

<head>
    <title>首页</title>
    @include('web.layout.head')
    <link rel="stylesheet" href="{{mix('/css/web/find/find.css')}}">
    <script src="{{mix('/js/web/index/scrollbar.js')}}"></script>
    <script src="{{mix('/js/web/frame/distpicker.js')}}"></script>
</head>
<body>
@include('web.layout.header_proscenium')
@include('web.layout.main_header')
@include('web.layout.main_header_nav')

<div class="find-pro">
    <div class="sbanner"><img src="{{asset('/img/web/find/find_bj.jpg')}}"></div>
</div>
<div class="width1200">
    <div class="aptitude_searchBox"  data-request="{{asset('/find/aptitude')}}">
        <form method="get" action="">
            <div class="aptitude_box fl">
                <span>资质选择</span>
                <div class="content">
                    <ul>
                        <li>
                            <div class="name">
                                <h1 class="zizhi1" data-id="1" data-value="1,2,3" name="zizhi1" onclick="setCookie(this);" data-title="电力工程专业承包">电力工程专业承包</h1>
                                <div class="level">
                                    <p class="zizhi1" data-id="1" name="zizhi1" data-value="1" onclick="setCookie(this);" data-title="电力工程专业承包 一级">一级</p>
                                    <p class="zizhi1" data-id="1" name="zizhi1" data-value="2" onclick="setCookie(this);" data-title="电力工程专业承包 二级">二级</p>
                                    <p class="zizhi1" data-id="1" name="zizhi1" data-value="3" onclick="setCookie(this);" data-title="电力工程专业承包 三级">三级</p>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="name">
                                <h1 class="zizhi2" data-id="2" data-value="1,2,3" name="zizhi2" onclick="setCookie(this);" data-title="电力智能化工程专业承包">电子与智能化工程专业承包</h1>
                                <div class="level">
                                    <p class="zizhi2" data-id="2" name="zizhi2" data-value="1" onclick="setCookie(this);" data-title="电力智能化工程专业承包 一级">一级</p>
                                    <p class="zizhi2" data-id="2" name="zizhi2" data-value="2" onclick="setCookie(this);" data-title="电力智能化工程专业承包 二级">二级</p>
                                    <p class="zizhi2" data-id="2" name="zizhi2" data-value="3" onclick="setCookie(this);" data-title="电力智能化工程专业承包 三级">三级</p>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="name">
                                <h1 class="zizhi3" data-id="3" data-value="1,2,3" name="zizhi3" onclick="setCookie(this);" data-title="电力工程专业承包">安防等级资质</h1>
                                <div class="level">
                                    <p class="zizhi3" data-id="3" name="zizhi3" data-value="1" onclick="setCookie(this);" data-title="电力工程专业承包 一级">一级</p>
                                    <p class="zizhi3" data-id="3" name="zizhi3" data-value="2" onclick="setCookie(this);" data-title="电力工程专业承包 二级">二级</p>
                                    <p class="zizhi3" data-id="3" name="zizhi3" data-value="3" onclick="setCookie(this);" data-title="电力工程专业承包 三级">三级</p>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="name">
                                <h1 class="zizhi4" data-id="4" data-value="1,2,3" name="zizhi4" onclick="setCookie(this);" data-title="建筑机电安装工程专业承包">建筑机电安装工程专业承包</h1>
                                <div class="level">
                                    <p class="zizhi4" data-id="4" name="zizhi4" data-value="1" onclick="setCookie(this);" data-title="建筑机电安装工程专业承包 一级">一级</p>
                                    <p class="zizhi4" data-id="4"name="zizhi4" data-value="2" onclick="setCookie(this);" data-title="建筑机电安装工程专业承包 二级">二级</p>
                                    <p class="zizhi4" data-id="4" name="zizhi4" data-value="3" onclick="setCookie(this);" data-title="建筑机电安装工程专业承包 三级">三级</p>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="name">
                                <h1 class="zizhi5" data-id="5" data-value="1,2,3" name="zizhi5" onclick="setCookie(this);" data-title="音视频工程专业承包">音视频工程专业承包</h1>
                                <div class="level">
                                    <p class="zizhi5" data-id="5" name="zizhi5" data-value="1" onclick="setCookie(this);" data-title="音视频工程专业承包 一级">一级</p>
                                    <p class="zizhi5" data-id="5" name="zizhi5" data-value="2" onclick="setCookie(this);" data-title="音视频工程专业承包 二级">二级</p>
                                    <p class="zizhi5" data-id="5" name="zizhi5" data-value="3" onclick="setCookie(this);" data-title="音视频工程专业承包 三级">三级</p>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="name">
                                <h1 class="zizhi6" data-id="6" data-value="1,2,3,4" name="zizhi6" onclick="setCookie(this);" data-title="计算机系统集成资质">计算机系统集成资质</h1>
                                <div class="level">
                                    <p class="zizhi6" data-id="6" name="zizhi6" data-value="1" onclick="setCookie(this);" data-title="计算机系统集成资质 一级">一级</p>
                                    <p class="zizhi6" data-id="6" name="zizhi6" data-value="2" onclick="setCookie(this);" data-title="计算机系统集成资质 二级">二级</p>
                                    <p class="zizhi6" data-id="6" name="zizhi6" data-value="3" onclick="setCookie(this);" data-title="计算机系统集成资质 三级">三级</p>
                                    <p class="zizhi6" data-id="6" name="zizhi6" data-value="4" onclick="setCookie(this);" data-title="计算机系统集成资质 四级">四级</p>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="name">
                                <h1 class="zizhi7" data-id="7" data-value="1,2,3" name="zizhi7" onclick="setCookie(this);" data-title="消防工程专业承包">消防工程专业承包</h1>
                                <div class="level">
                                    <p class="zizhi7" data-id="7" name="zizhi7" data-value="1" onclick="setCookie(this);" data-title="消防工程专业承包 一级">一级</p>
                                    <p class="zizhi7" data-id="7" name="zizhi7" data-value="2" onclick="setCookie(this);" data-title="消防工程专业承包 二级">二级</p>
                                    <p class="zizhi7" data-id="7" name="zizhi7" data-value="3" onclick="setCookie(this);" data-title="消防工程专业承包 三级">三级</p>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="name">
                                <h1 class="zizhi8" data-id="8" data-value="1,2,3" name="zizhi8" onclick="setCookie(this);" data-title="通讯系统集成">通讯系统集成</h1>
                                <div class="level">
                                    <p class="zizhi8" data-id="8" name="zizhi8" data-value="1" onclick="setCookie(this);" data-title="通讯系统集成 一级">一级</p>
                                    <p class="zizhi8" data-id="8" name="zizhi8" data-value="2" onclick="setCookie(this);" data-title="通讯系统集成 二级">二级</p>
                                    <p class="zizhi8" data-id="8" name="zizhi8" data-value="3" onclick="setCookie(this);" data-title="通讯系统集成 三级">三级</p>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="name">
                                <h1 class="zizhi9" data-id="9" data-value="1,2,3" name="zizhi9" onclick="setCookie(this);" data-title="电子与智能化的工业设计">电子与智能化的工业设计</h1>
                                <div class="level">
                                    <p class="zizhi9" data-id="9" name="zizhi9" data-value="1" onclick="setCookie(this);" data-title="电子与智能化的工业设计 一级">一级</p>
                                    <p class="zizhi9" data-id="9" name="zizhi9" data-value="2" onclick="setCookie(this);" data-title="电子与智能化的工业设计 二级">二级</p>
                                    <p class="zizhi9" data-id="9" name="zizhi9" data-value="3" onclick="setCookie(this);" data-title="电子与智能化的工业设计 三级">三级</p>
                                </div>
                            </div>
                        </li>
                        <li>
                            <input class="zizhi11" data-id="11" type="text" placeholder="请输入其他资质" class="zizhi11" id="zizhi11" name="zizhi11" onblur="blurCookie(this);">
                        </li>
                    </ul>
                </div>
            </div>
            <div class="aptitude_box fl">
                <span>地区选择</span>
                <div class="content" id="distpicker">
                    <select class="province" name="province_id">
                        <option>请选择省份</option>
                    </select>
                    <select class="city" name="city_id">
                        <option>请选择城市</option>
                    </select>
                </div>
            </div>
            <div class="aptitude_box fl">
                <span>注册资金</span>
                <div class="content">
                    <input type="text" name="start_capital" class="start_capital" value="" onkeyup="this.value=this.value.replace(/[^\d]/g,'') ">
                    <font>至</font>
                    <input type="text" name="end_capital" class="end_capital" value="" onkeyup="this.value=this.value.replace(/[^\d]/g,'') ">
                    <font>元</font>
                </div>
            </div>

        </form>
    </div>
    <div class="xuan_result" id="xuan_result">
        <div class="left">所有资质:</div>
        <div class="right">
            <ul id="xuan_result_ul">
                <!-- <li data-id="zizhi1">电子与智能化工程专业承包<span>×</span></li>
                <li data-id="zizhi2">音视频工程专业承包<span>×</span></li> -->
            </ul>
        </div>
    </div>
    <div class="table">
        <table>
            <thead>
            <tr>
                <th width="40">序号</th>
                <th width="220">企业名称</th>
                <th width="100">所在省份</th>
                <th width="300">资质范围</th>
                <th width="120">操作</th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td>1</td>
                <td>银江股份有限公司</td>
                <td>浙江杭州</td>
                <td>
                    <div class="range">
                        信息系统集成及服务大型一级资质 信息系统集成及服务运行维护分项二级资质 电子与智能化工程专业承包一级资质建筑机电安装工程专业承包一级资质 公路交通工程
                    </div>
                </td>
                <td>
                    <a class="btn_contact" target="_blank" href="/shop/service/1">查看详情</a>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
    <div class="page">
        include('web.layout.page')
    </div>
</div>
@include('web.layout.footer_ware1')

</body>
<script type="text/javascript">
    var params = {
        zizhi1:'',
        zizhi2:'',
        zizhi3:'',
        zizhi4:'',
        zizhi5:'',
        zizhi6:'',
        zizhi7:'',
        zizhi8:'',
        zizhi9:'',
        zizhi11:'',
        province:'',
        city:''
    };
    function setCookie(it){

        var name = $(it).attr('name');
        var value = $(it).attr('data-value');
        var title = $(it).attr('data-title');
        //console.log(name,value,title)
        params[name] = value;
        submit_search();
    }
    function blurCookie(it){

        var id = $(it).attr('data-id');
        params['zizhi'+id] = $(it).val();
        //console.log(111111,id)
        submit_search();
    }

    $(document).ready(function(){
        var province = "";
        var city = "";
        $('#distpicker').distpicker({
            province: province,
            city: city
        });

        params.zizhi1 = $.getUrlParam('zizhi1');
        params.zizhi2 = $.getUrlParam('zizhi2');
        params.zizhi3 = $.getUrlParam('zizhi3');
        params.zizhi4 = $.getUrlParam('zizhi4');
        params.zizhi5 = $.getUrlParam('zizhi5');
        params.zizhi6 = $.getUrlParam('zizhi6');
        params.zizhi7 = $.getUrlParam('zizhi7');
        params.zizhi8 = $.getUrlParam('zizhi8');
        params.zizhi9 = $.getUrlParam('zizhi9');
        params.zizhi11 = decodeURI(decodeURI($.getUrlParam('zizhi11')));
        for(var i = 1; i<=9; i++){
            //console.log('1',params['zizhi'+i])
            if(params['zizhi'+i] != '' && params['zizhi'+i] != null){
                $(".zizhi"+i).each(function(index, el) {
                    if($(this).attr('data-value') == params['zizhi'+i]){
                        var html = '<li data-id="zizhi'+i+'">'+$(this).attr('data-title')+'<span>×</span></li>';
                        $('#xuan_result_ul').append(html);
                    }
                });
            }
        }
        //console.log(params['zizhi11'])
        if(params['zizhi11'] && params['zizhi11'] != 'null'){
            var html = '<li data-id="zizhi11">'+params['zizhi11']+'<span>×</span></li>';
            $('#xuan_result_ul').append(html);
        }

        //console.log('params.zizhi1',params.zizhi1)
        $(document).on('click','#xuan_result_ul li',function () {
            var id = $(this).attr('data-id');
            params[id] = '';
            submit_search();
        })
        $(document).on('change','.province ,.city',function () {
            submit_search();
        })
        $(document).on('blur','.start_capital,.end_capital',function () {
            if($('.start_capital').val() !='' && $('.end_capital').val() !=''){
                if($('.start_capital').val() > $('.end_capital').val()){
                    layer.alert('请输入正确的注册资金搜索范围', {
                        title:'提示',
                        icon: 2
                    });
                }else{
                    submit_search();
                }
            }

        })
    });
    function submit_search() {
        var request_url = $('.aptitude_searchBox').data('request');

        var date = [
            'zizhi1=' + params.zizhi1,
            'zizhi2=' + params.zizhi2,
            'zizhi3=' + params.zizhi3,
            'zizhi4=' + params.zizhi4,
            'zizhi5=' + params.zizhi5,
            'zizhi6=' + params.zizhi6,
            'zizhi7=' + params.zizhi7,
            'zizhi8=' + params.zizhi8,
            'zizhi9=' + params.zizhi9,
            'zizhi11=' + params.zizhi11,
            'province=' + $('.province option:selected').val(),
            'city=' + $('.city option:selected').val(),
            'start_capital=' + $('.start_capital').val(),
            'end_capital=' + $('.end_capital').val()
        ];

        var url_date = date.join("&");
        location.href = encodeURI(encodeURI(request_url + "?" + url_date));
    }
</script>
</html>